package main

import (
	"context"
	trippb "coolcar/trip/api/gen/v1"
	"fmt"
	"log"

	"google.golang.org/grpc"
)

func main() {
	log.SetFlags(log.Lshortfile)
	conn, err := grpc.Dial("localhost:8081", grpc.WithInsecure())
	if err != nil {
		log.Fatalf("can not Dial 8081 : %v", err)
	}
	client := trippb.NewTripServiceClient(conn)
	trip, err := client.GetTrip(context.Background(), &trippb.GetTripRequest{Id: "trip123"})
	if err != nil {
		log.Fatalf("can not get trip : %v", err)
	}
	fmt.Println(trip)
}
